package com.zhouyu.gamecommunity.controller;

import com.zhouyu.gamecommunity.entity.Message;
import com.zhouyu.gamecommunity.entity.PageData;
import com.zhouyu.gamecommunity.entity.Result;
import com.zhouyu.gamecommunity.service.MessageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {

    @Resource
    private MessageService messageService;

    @GetMapping("/list/{type}/{page}")
    private Result<PageData<Message>> getMessageList(@PathVariable("type") String type, @PathVariable("page") int page){
        return messageService.getMessageList(type, page);
    }
}
